{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/Drew/Dropbox/Emory/Ongoing Projects/generals project/FPA_manuscript/log_20170326.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}26 Mar 2017, 17:48:00

{com}. do "/var/folders/d4/6gqm1mxx0ldg_06bfwv5hxy80000gn/T//SD40586.000000"
{txt}
{com}. insheet using "~/Downloads/generals_data1.tab", t clear
{txt}(50 vars, 1,704 obs)

{com}. 
{txt}end of do-file

{com}. do "/var/folders/d4/6gqm1mxx0ldg_06bfwv5hxy80000gn/T//SD40586.000000"
{txt}
{com}. ***************************************************************
. ********************** FIGURE 1 *******************************
. ***************************************************************
. 
. graph bar (sum) demotioncommand, over(year) over(allegiance) ytitle(Demotions)
{res}{txt}
{com}. 
. ***************************************************************
. ********************** FIGURE 2 *******************************
. ***************************************************************
. 
. graph bar (sum) promotioncommand, over(year) over(allegiance) ytitle(Promotions)
{res}{txt}
{com}. 
. ***************************************************************
. ********************** TABLE 1 ********************************
. ***************************************************************
. 
. summarize outcomeave2final

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
outco~2final {c |}{res}      1,508    .3587533    .5362843         -1          1
{txt}
{com}. summarize outcomeave2final if countrycode == 2

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
outco~2final {c |}{res}        631    .6664025    .4092729        -.5          1
{txt}
{com}. summarize outcomeave2final if countrycode == 255

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
outco~2final {c |}{res}        877    .1374002    .5070207         -1          1
{txt}
{com}. summarize milacademy if countrycode == 2

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 2}milacademy {c |}{res}        693    .5598846    .4967594          0          1
{txt}
{com}. summarize ss if countrycode == 255

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
{space 10}ss {c |}{res}      1,007    .0595829    .2368301          0          1
{txt}
{com}. 
{txt}end of do-file

{com}. do "/var/folders/d4/6gqm1mxx0ldg_06bfwv5hxy80000gn/T//SD40586.000000"
{txt}
{com}. ***************************************************************
. ********************** TABLE 2 ********************************
. ***************************************************************
. 
. stset counter, id(gennum) failure(compete=1) /* compete = 1 refers to command demotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          4{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1699{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       1699{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model one
. stcrreg  outcomeave2final  if fighting==1, compete(compete=2) 
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-64.335234}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-64.329494}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-64.329494}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        24
{txt}{col 50}No. censored{col 67}={col 69}{res}       243

{col 50}{txt}Wald chi2({res}1{txt}){col 67}={col 70}{res}     6.05
{txt}Log pseudolikelihood = {res}-64.329494{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0139

{txt}{ralign 79:(Std. Err. adjusted for {res:281} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2}  .380353{col 27}{space 2} .1494241{col 38}{space 1}   -2.46{col 47}{space 3}0.014{col 55}{space 4} .1761111{col 68}{space 3} .8214608
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model three
. stcrreg  outcomeave2final milacademy if fighting==1 & countrycode == 2, compete(compete=2) 
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-19.955998}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-19.955712}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-19.955712}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       488
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        85
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         6
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        10
{txt}{col 50}No. censored{col 67}={col 69}{res}        69

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}    11.01
{txt}Log pseudolikelihood = {res}-19.955712{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0041

{txt}{ralign 79:(Std. Err. adjusted for {res:85} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .1428918{col 27}{space 2} .0841503{col 38}{space 1}   -3.30{col 47}{space 3}0.001{col 55}{space 4} .0450533{col 68}{space 3} .4531976
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} .8843632{col 27}{space 2} .6454854{col 38}{space 1}   -0.17{col 47}{space 3}0.866{col 55}{space 4} .2115191{col 68}{space 3}  3.69753
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model five
. stcrreg  outcomeave2final ss if fighting==1 & countrycode == 255, compete(compete=2) tvc(outcomeave2final)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-29.148199}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-29.147483}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-29.147476}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-29.147476}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       729
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       195
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         8
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        14
{txt}{col 50}No. censored{col 67}={col 69}{res}       173

{col 50}{txt}Wald chi2({res}3{txt}){col 67}={col 70}{res}   659.83
{txt}Log pseudolikelihood = {res}-29.147476{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{ralign 79:(Std. Err. adjusted for {res:195} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}main          {txt}{c |}
outcomeave2~l {c |}{col 15}{res}{space 2} .0098896{col 27}{space 2} .0088804{col 38}{space 1}   -5.14{col 47}{space 3}0.000{col 55}{space 4} .0017015{col 68}{space 3}   .05748
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 2.49e-07{col 27}{space 2} 1.53e-07{col 38}{space 1}  -24.69{col 47}{space 3}0.000{col 55}{space 4} 7.45e-08{col 68}{space 3} 8.33e-07
{txt}{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}tvc           {txt}{c |}
outcomeave2~l {c |}{col 15}{res}{space 2}  2.07716{col 27}{space 2} .3758376{col 38}{space 1}    4.04{col 47}{space 3}0.000{col 55}{space 4} 1.456985{col 68}{space 3} 2.961317
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 4 2}Note: Variables in {res}tvc 
{txt}equation interacted with _t.{p_end}

{com}. 
. ***************************************************************
. 
. stset counter, id(gennum) failure(compete=2) /* compete = 2 refers to command promotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 2
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          3{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1700{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         30{txt}  failures in single-failure-per-subject data
{res}       1700{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model two
. stcrreg  outcomeave2final  if fighting==1, compete(compete=1) 
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-87.885444}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-87.836471}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res: -87.83645}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res: -87.83645}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        23
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}        14
{txt}{col 50}No. censored{col 67}={col 69}{res}       244

{col 50}{txt}Wald chi2({res}1{txt}){col 67}={col 70}{res}     0.08
{txt}Log pseudolikelihood = {res} -87.83645{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.7812

{txt}{ralign 79:(Std. Err. adjusted for {res:281} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .8858849{col 27}{space 2} .3865067{col 38}{space 1}   -0.28{col 47}{space 3}0.781{col 55}{space 4} .3767062{col 68}{space 3}   2.0833
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model four
. stcrreg  outcomeave2final milacademy if fighting==1 & countrycode == 2, compete(compete=1) 
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-22.212447}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-22.154007}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-22.153887}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-22.153887}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       488
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        85
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}         9
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         6
{txt}{col 50}No. censored{col 67}={col 69}{res}        70

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}     0.22
{txt}Log pseudolikelihood = {res}-22.153887{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.8954

{txt}{ralign 79:(Std. Err. adjusted for {res:85} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2}  1.27428{col 27}{space 2} 1.612702{col 38}{space 1}    0.19{col 47}{space 3}0.848{col 55}{space 4} .1066603{col 68}{space 3} 15.22394
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} .8500334{col 27}{space 2}   .45345{col 38}{space 1}   -0.30{col 47}{space 3}0.761{col 55}{space 4} .2987877{col 68}{space 3} 2.418294
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model six
. stcrreg  outcomeave2final ss  if fighting==1 & countrycode == 255, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res: -52.08251}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-52.073904}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-52.073904}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       729
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       195
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         8
{txt}{col 50}No. censored{col 67}={col 69}{res}       173

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}     0.53
{txt}Log pseudolikelihood = {res}-52.073904{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.7679

{txt}{ralign 79:(Std. Err. adjusted for {res:195} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} 1.158536{col 27}{space 2} .6904578{col 38}{space 1}    0.25{col 47}{space 3}0.805{col 55}{space 4} .3602594{col 68}{space 3} 3.725666
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 1.964796{col 27}{space 2} 1.927542{col 38}{space 1}    0.69{col 47}{space 3}0.491{col 55}{space 4} .2872468{col 68}{space 3} 13.43939
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. ***************************************************************
. ********************** FIGURE 3 *******************************
. ***************************************************************
. 
. stset counter, id(gennum) failure(compete=1) /* compete = 1 refers to command demotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          4{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1699{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       1699{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. stcrreg  outcomeave2final  if fighting==1 , compete(compete=2) 
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-64.335234}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-64.329494}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-64.329494}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        24
{txt}{col 50}No. censored{col 67}={col 69}{res}       243

{col 50}{txt}Wald chi2({res}1{txt}){col 67}={col 70}{res}     6.05
{txt}Log pseudolikelihood = {res}-64.329494{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0139

{txt}{ralign 79:(Std. Err. adjusted for {res:281} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2}  .380353{col 27}{space 2} .1494241{col 38}{space 1}   -2.46{col 47}{space 3}0.014{col 55}{space 4} .1761111{col 68}{space 3} .8214608
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. stcurve, cif at1(outcomeave2final = -1) at2(outcomeave2final = 0) at3(outcomeave2final = 1)
{res}{txt}
{com}. 
. ***************************************************************
. ********************** FIGURE 4 *******************************
. ***************************************************************
. 
. stset counter, id(gennum) failure(compete=1) /* compete = 1 refers to command demotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          4{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1699{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       1699{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. stcrreg  outcomeave2final milacademy if fighting==1 & countrycode==2, compete(compete=2)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-19.955998}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-19.955712}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-19.955712}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       488
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        85
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         6
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        10
{txt}{col 50}No. censored{col 67}={col 69}{res}        69

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}    11.01
{txt}Log pseudolikelihood = {res}-19.955712{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0041

{txt}{ralign 79:(Std. Err. adjusted for {res:85} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .1428918{col 27}{space 2} .0841503{col 38}{space 1}   -3.30{col 47}{space 3}0.001{col 55}{space 4} .0450533{col 68}{space 3} .4531976
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} .8843632{col 27}{space 2} .6454854{col 38}{space 1}   -0.17{col 47}{space 3}0.866{col 55}{space 4} .2115191{col 68}{space 3}  3.69753
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. stcurve, cif at1(outcomeave2final = -1) at2(outcomeave2final = 0) at3(outcomeave2final = 1)
{res}{txt}
{com}. 
. ***************************************************************
. ********************** FIGURE 5 *******************************
. ***************************************************************
. 
. insheet using "~/Downloads/generals_data1.tab", t clear
{txt}(50 vars, 1,704 obs)

{com}. stset counter, id(gennum) failure(compete=1) /* compete = 1 refers to command demotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          4{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1699{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       1699{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. gen outcome_count = outcomeave2final*counter
{txt}(196 missing values generated)

{com}. generate id = _n
{txt}
{com}. streset, id(id)
{txt}-> stset counter, id(id) failure(compete==1)

                id:  {res}id
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  event time missing (counter>=.)                    PROBABLE ERROR
{hline 78}
{res}       1703{txt}  observations remaining, representing
{res}       1703{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       8124{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. stsplit, at(failures)
{txt}(8 failure times)
(4,934 observations (episodes) created)

{com}. stcox  outcomeave2final outcome_count ss if fighting==1 & countrycode==255 

         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}id

{txt}Iteration 0:   log likelihood = {res}-44.133754
{txt}Iteration 1:   log likelihood = {res}-39.788705
{txt}Iteration 2:   log likelihood = {res}-39.706664
{txt}Iteration 3:   log likelihood = {res}-39.678054
{txt}Iteration 4:   log likelihood = {res}-39.667611
{txt}Iteration 5:   log likelihood = {res}-39.663781
{txt}Iteration 6:   log likelihood = {res}-39.662373
{txt}Iteration 7:   log likelihood = {res}-39.661855
{txt}Iteration 8:   log likelihood = {res}-39.661665
{txt}Iteration 9:   log likelihood = {res}-39.661595
{txt}Iteration 10:  log likelihood = {res}-39.661569
{txt}Iteration 11:  log likelihood = {res} -39.66156
{txt}Iteration 12:  log likelihood = {res}-39.661556
{txt}Iteration 13:  log likelihood = {res}-39.661555
{txt}Iteration 14:  log likelihood = {res}-39.661555
{txt}Iteration 15:  log likelihood = {res}-39.661554
{txt}Iteration 16:  log likelihood = {res}-39.661554
{txt}Iteration 17:  log likelihood = {res}-39.661554
{txt}Iteration 18:  log likelihood = {res}-39.661554
{txt}Iteration 19:  log likelihood = {res}-39.661554
{txt}Iteration 20:  log likelihood = {res}-39.661554
{txt}Iteration 21:  log likelihood = {res}-39.661554
{txt}Iteration 22:  log likelihood = {res}-39.661554
{txt}Iteration 23:  log likelihood = {res}-39.661554
{txt}Iteration 24:  log likelihood = {res}-39.661554
{txt}Iteration 25:  log likelihood = {res}-39.661554
{txt}Iteration 26:  log likelihood = {res}-39.661554
{txt}Iteration 27:  log likelihood = {res}-39.661554
{txt}Iteration 28:  log likelihood = {res}-39.661554
{txt}Iteration 29:  log likelihood = {res}-39.661554
{txt}Iteration 30:  log likelihood = {res}-39.661554
{txt}Iteration 31:  log likelihood = {res}-39.661554
{txt}Iteration 32:  log likelihood = {res}-39.661554
{txt}Iteration 33:  log likelihood = {res}-39.661554
{txt}Iteration 34:  log likelihood = {res}-39.661554
{txt}Iteration 35:  log likelihood = {res}-39.661554
{txt}Iteration 36:  log likelihood = {res}-39.661554
{txt}Iteration 37:  log likelihood = {res}-39.661554
{txt}Iteration 38:  log likelihood = {res}-39.661554
{txt}Iteration 39:  log likelihood = {res}-39.661554
{txt}Iteration 40:  log likelihood = {res}-39.661554
{txt}Iteration 41:  log likelihood = {res}-39.661554
{txt}Iteration 42:  log likelihood = {res}-39.661554
{txt}Iteration 43:  log likelihood = {res}-39.661554
{txt}Refining estimates:
Iteration 0:   log likelihood = {res}-39.661554

{txt}Cox regression -- Breslow method for ties

No. of subjects = {res}         729                  {txt}Number of obs    =  {res}     2,757
{txt}No. of failures = {res}           8
{txt}Time at risk    = {res}        3222
                                                {txt}LR chi2({res}2{txt})       =  {res}      8.94
{txt}Log likelihood  =   {res}-39.661554                  {txt}Prob > chi2      =  {res}    0.0114

{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}           _t{col 15}{c |} Haz. Ratio{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2}  .020542{col 27}{space 2} .0278723{col 38}{space 1}   -2.86{col 47}{space 3}0.004{col 55}{space 4} .0014378{col 68}{space 3} .2934892
{txt}outcome_count {c |}{col 15}{res}{space 2}  1.37832{col 27}{space 2}  .191616{col 38}{space 1}    2.31{col 47}{space 3}0.021{col 55}{space 4} 1.049578{col 68}{space 3} 1.810028
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 3.38e-19{col 27}{space 2}        .{col 38}{space 1}       .{col 47}{space 3}    .{col 55}{space 4}        .{col 68}{space 3}        .
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. stcurve, cumhaz at1(outcomeave2final = -1) at2(outcomeave2final = 0) at3(outcomeave2final = 1)
{res}{txt}
{com}. 
. ***************************************************************
. ********************** TABLE 3 ********************************
. ***************************************************************
. 
. * reload data because of transformation for Figure 5
. insheet using "~/Downloads/generals_data1.tab", t clear
{txt}(50 vars, 1,704 obs)

{com}. 
. reg  perfchange4 demotiondummy if fighting==1, r cluster(gennum)

{txt}Linear regression                               Number of obs     = {res}        69
                                                {txt}{help j_robustsingular:F(0, 56) }         =  {res}        .
                                                {txt}Prob > F          = {res}         .
                                                {txt}R-squared         = {res}    0.0203
                                                {txt}Root MSE          =    {res} .85506

{txt}{ralign 79:(Std. Err. adjusted for {res:57} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}  perfchange4{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
demotiondummy {c |}{col 15}{res}{space 2} 1.014706{col 27}{space 2} .1085645{col 38}{space 1}    9.35{col 47}{space 3}0.000{col 55}{space 4} .7972251{col 68}{space 3} 1.232187
{txt}{space 8}_cons {c |}{col 15}{res}{space 2} .9852941{col 27}{space 2} .1085645{col 38}{space 1}    9.08{col 47}{space 3}0.000{col 55}{space 4} .7678134{col 68}{space 3} 1.202775
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
{txt}end of do-file

{com}. do "/var/folders/d4/6gqm1mxx0ldg_06bfwv5hxy80000gn/T//SD40586.000000"
{txt}
{com}. 
. ***************************************************************
. ********************** TABLE 4 ********************************
. ***************************************************************
. 
. reg outcome_v2 compar_test_dummy  if compar_test_dummy==1 | compar_test_dummy03==1, r cluster(gennum)

{txt}Linear regression                               Number of obs     = {res}        71
                                                {txt}F(1, 68)          =  {res}     7.01
                                                {txt}Prob > F          = {res}    0.0101
                                                {txt}R-squared         = {res}    0.0519
                                                {txt}Root MSE          =    {res} .65842

{txt}{ralign 79:(Std. Err. adjusted for {res:69} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}   outcome_v2{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
compar_test~y {c |}{col 15}{res}{space 2} .4801587{col 27}{space 2}  .181401{col 38}{space 1}    2.65{col 47}{space 3}0.010{col 55}{space 4} .1181786{col 68}{space 3} .8421388
{txt}{space 8}_cons {c |}{col 15}{res}{space 2} .2698413{col 27}{space 2} .0858441{col 38}{space 1}    3.14{col 47}{space 3}0.002{col 55}{space 4} .0985421{col 68}{space 3} .4411404
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. ***************************************************************
. ********************** APPENDIX *******************************
. ***************************************************************
. 
. ***************************************************************
. ********************** TABLE A1 *******************************
. ***************************************************************
. 
. stset counter, id(gennum) failure(compete=1) /* compete = 1 refers to command demotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          4{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1699{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       1699{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model one
. stcrreg  outcomeave3final  if fighting==1, compete(compete=2) tvc(outcomeave3final)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-35.453606}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res: -35.45233}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res: -35.45233}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,054
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       260
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         9
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        21
{txt}{col 50}No. censored{col 67}={col 69}{res}       230

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}    11.13
{txt}Log pseudolikelihood = {res} -35.45233{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0038

{txt}{ralign 79:(Std. Err. adjusted for {res:260} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}main          {txt}{c |}
outcomeave3~l {c |}{col 15}{res}{space 2} .0094318{col 27}{space 2} .0134657{col 38}{space 1}   -3.27{col 47}{space 3}0.001{col 55}{space 4} .0005746{col 68}{space 3} .1548268
{txt}{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}tvc           {txt}{c |}
outcomeave3~l {c |}{col 15}{res}{space 2} 1.933409{col 27}{space 2} .5322831{col 38}{space 1}    2.39{col 47}{space 3}0.017{col 55}{space 4} 1.127149{col 68}{space 3} 3.316396
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 4 2}Note: Variables in {res}tvc 
{txt}equation interacted with _t.{p_end}

{com}. * model three
. stcrreg  outcomeave3final milacademy if fighting==1 & countrycode == 2, compete(compete=2) tvc(outcomeave3final)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-9.4666689}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-9.4654188}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-9.4654186}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       442
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        84
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         3
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}         9
{txt}{col 50}No. censored{col 67}={col 69}{res}        72

{col 50}{txt}Wald chi2({res}3{txt}){col 67}={col 70}{res}    26.55
{txt}Log pseudolikelihood = {res}-9.4654186{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{ralign 79:(Std. Err. adjusted for {res:84} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}main          {txt}{c |}
outcomeave3~l {c |}{col 15}{res}{space 2} .0007298{col 27}{space 2} .0012577{col 38}{space 1}   -4.19{col 47}{space 3}0.000{col 55}{space 4} .0000249{col 68}{space 3} .0213809
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} .3342136{col 27}{space 2} .4169835{col 38}{space 1}   -0.88{col 47}{space 3}0.380{col 55}{space 4} .0289746{col 68}{space 3} 3.855054
{txt}{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}tvc           {txt}{c |}
outcomeave3~l {c |}{col 15}{res}{space 2} 4.157956{col 27}{space 2} 1.760655{col 38}{space 1}    3.37{col 47}{space 3}0.001{col 55}{space 4} 1.813197{col 68}{space 3}  9.53487
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 4 2}Note: Variables in {res}tvc 
{txt}equation interacted with _t.{p_end}

{com}. * model five
. stcrreg  outcomeave3final ss if fighting==1 & countrycode == 255, compete(compete=2) tvc(outcomeave3final)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-18.461618}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-18.458172}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-18.458167}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-18.458166}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       611
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       175
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         6
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        12
{txt}{col 50}No. censored{col 67}={col 69}{res}       157

{col 50}{txt}Wald chi2({res}3{txt}){col 67}={col 70}{res}   453.80
{txt}Log pseudolikelihood = {res}-18.458166{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{ralign 79:(Std. Err. adjusted for {res:175} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}main          {txt}{c |}
outcomeave3~l {c |}{col 15}{res}{space 2} .0018929{col 27}{space 2} .0024378{col 38}{space 1}   -4.87{col 47}{space 3}0.000{col 55}{space 4} .0001517{col 68}{space 3} .0236249
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 4.26e-07{col 27}{space 2} 3.22e-07{col 38}{space 1}  -19.38{col 47}{space 3}0.000{col 55}{space 4} 9.67e-08{col 68}{space 3} 1.88e-06
{txt}{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}tvc           {txt}{c |}
outcomeave3~l {c |}{col 15}{res}{space 2} 2.271867{col 27}{space 2} .5118741{col 38}{space 1}    3.64{col 47}{space 3}0.000{col 55}{space 4} 1.460827{col 68}{space 3}  3.53319
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 4 2}Note: Variables in {res}tvc 
{txt}equation interacted with _t.{p_end}

{com}. 
. ******
. 
. stset counter, id(gennum) failure(compete=2) /* compete = 2 refers to command promotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 2
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          3{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1700{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         30{txt}  failures in single-failure-per-subject data
{res}       1700{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model two
. stcrreg  outcomeave3final  if fighting==1, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-73.395313}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res: -73.38531}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-73.385308}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,054
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       260
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        21
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         9
{txt}{col 50}No. censored{col 67}={col 69}{res}       230

{col 50}{txt}Wald chi2({res}1{txt}){col 67}={col 70}{res}     0.06
{txt}Log pseudolikelihood = {res}-73.385308{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.8128

{txt}{ralign 79:(Std. Err. adjusted for {res:260} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave3~l {c |}{col 15}{res}{space 2} 1.111406{col 27}{space 2}  .495798{col 38}{space 1}    0.24{col 47}{space 3}0.813{col 55}{space 4}  .463609{col 68}{space 3} 2.664364
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model four
. stcrreg  outcomeave3final milacademy if fighting==1 & countrycode == 2, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-19.855138}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-19.853276}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-19.853276}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       442
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        84
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}         9
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         3
{txt}{col 50}No. censored{col 67}={col 69}{res}        72

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}     0.47
{txt}Log pseudolikelihood = {res}-19.853276{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.7887

{txt}{ralign 79:(Std. Err. adjusted for {res:84} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave3~l {c |}{col 15}{res}{space 2} .6032167{col 27}{space 2} .5674653{col 38}{space 1}   -0.54{col 47}{space 3}0.591{col 55}{space 4} .0954379{col 68}{space 3} 3.812641
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} 1.179703{col 27}{space 2}  .665237{col 38}{space 1}    0.29{col 47}{space 3}0.769{col 55}{space 4} .3906417{col 68}{space 3}   3.5626
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model six
. stcrreg  outcomeave3final ss  if fighting==1 & countrycode == 255, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-39.790404}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-39.787614}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-39.787614}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       611
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       175
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        12
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         6
{txt}{col 50}No. censored{col 67}={col 69}{res}       157

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}     2.73
{txt}Log pseudolikelihood = {res}-39.787614{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.2549

{txt}{ralign 79:(Std. Err. adjusted for {res:175} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave3~l {c |}{col 15}{res}{space 2} 2.410611{col 27}{space 2} 1.553227{col 38}{space 1}    1.37{col 47}{space 3}0.172{col 55}{space 4}  .681825{col 68}{space 3} 8.522779
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 2.726848{col 27}{space 2} 2.313936{col 38}{space 1}    1.18{col 47}{space 3}0.237{col 55}{space 4} .5168355{col 68}{space 3} 14.38697
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. ***************************************************************
. ********************** TABLE A2 *******************************
. ***************************************************************
. 
. stset counter, id(gennum) failure(compete=1) /* compete = 1 refers to command demotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          4{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1699{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       1699{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model one
. stcrreg  outcomeave2final  if fighting==1, compete(compete=2) cluster(divid)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-64.335234}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-64.329494}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-64.329494}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        24
{txt}{col 50}No. censored{col 67}={col 69}{res}       243

{col 50}{txt}Wald chi2({res}1{txt}){col 67}={col 70}{res}     6.36
{txt}Log pseudolikelihood = {res}-64.329494{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0117

{txt}{ralign 79:(Std. Err. adjusted for {res:181} clusters in divid)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2}  .380353{col 27}{space 2}  .145763{col 38}{space 1}   -2.52{col 47}{space 3}0.012{col 55}{space 4} .1794652{col 68}{space 3} .8061086
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model three
. stcrreg  outcomeave2final milacademy if fighting==1 & countrycode == 2, compete(compete=2) cluster(divid)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-19.955998}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-19.955712}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-19.955712}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       488
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        85
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         6
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        10
{txt}{col 50}No. censored{col 67}={col 69}{res}        69

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}    11.58
{txt}Log pseudolikelihood = {res}-19.955712{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0031

{txt}{ralign 79:(Std. Err. adjusted for {res:64} clusters in divid)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .1428918{col 27}{space 2} .0825342{col 38}{space 1}   -3.37{col 47}{space 3}0.001{col 55}{space 4} .0460631{col 68}{space 3} .4432624
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} .8843632{col 27}{space 2} .6216037{col 38}{space 1}   -0.17{col 47}{space 3}0.861{col 55}{space 4} .2230158{col 68}{space 3} 3.506918
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model five
. stcrreg  outcomeave2final ss if fighting==1 & countrycode == 255, compete(compete=2) tvc(outcomeave2final) cluster(divid)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-29.148199}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-29.147483}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-29.147476}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-29.147476}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       729
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       195
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         8
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        14
{txt}{col 50}No. censored{col 67}={col 69}{res}       173

{col 50}{txt}Wald chi2({res}3{txt}){col 67}={col 70}{res}   558.82
{txt}Log pseudolikelihood = {res}-29.147476{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{ralign 79:(Std. Err. adjusted for {res:117} clusters in divid)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}main          {txt}{c |}
outcomeave2~l {c |}{col 15}{res}{space 2} .0098896{col 27}{space 2} .0086434{col 38}{space 1}   -5.28{col 47}{space 3}0.000{col 55}{space 4} .0017833{col 68}{space 3} .0548435
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 2.49e-07{col 27}{space 2} 1.66e-07{col 38}{space 1}  -22.75{col 47}{space 3}0.000{col 55}{space 4} 6.72e-08{col 68}{space 3} 9.23e-07
{txt}{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}tvc           {txt}{c |}
outcomeave2~l {c |}{col 15}{res}{space 2}  2.07716{col 27}{space 2} .3645401{col 38}{space 1}    4.17{col 47}{space 3}0.000{col 55}{space 4}   1.4726{col 68}{space 3} 2.929917
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 4 2}Note: Variables in {res}tvc 
{txt}equation interacted with _t.{p_end}

{com}. 
. ******
. 
. stset counter, id(gennum) failure(compete=2) /* compete = 2 refers to command promotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 2
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          3{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1700{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         30{txt}  failures in single-failure-per-subject data
{res}       1700{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model two
. stcrreg  outcomeave2final  if fighting==1, compete(compete=1) cluster(divid)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-87.885444}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-87.836471}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res: -87.83645}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res: -87.83645}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        23
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}        14
{txt}{col 50}No. censored{col 67}={col 69}{res}       244

{col 50}{txt}Wald chi2({res}1{txt}){col 67}={col 70}{res}     0.07
{txt}Log pseudolikelihood = {res} -87.83645{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.7915

{txt}{ralign 79:(Std. Err. adjusted for {res:182} clusters in divid)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .8858849{col 27}{space 2} .4059548{col 38}{space 1}   -0.26{col 47}{space 3}0.791{col 55}{space 4} .3608412{col 68}{space 3} 2.174896
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model four
. stcrreg  outcomeave2final milacademy if fighting==1 & countrycode == 2, compete(compete=1) cluster(divid) 
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-22.212447}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-22.154007}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-22.153887}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-22.153887}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       488
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        85
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}         9
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         6
{txt}{col 50}No. censored{col 67}={col 69}{res}        70

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}     0.17
{txt}Log pseudolikelihood = {res}-22.153887{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.9208

{txt}{ralign 79:(Std. Err. adjusted for {res:65} clusters in divid)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2}  1.27428{col 27}{space 2} 1.731755{col 38}{space 1}    0.18{col 47}{space 3}0.858{col 55}{space 4} .0888131{col 68}{space 3} 18.28324
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} .8500334{col 27}{space 2} .4696953{col 38}{space 1}   -0.29{col 47}{space 3}0.769{col 55}{space 4} .2878029{col 68}{space 3} 2.510596
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model six
. stcrreg  outcomeave2final ss  if fighting==1 & countrycode == 255, compete(compete=1) cluster(divid)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res: -52.08251}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-52.073904}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-52.073904}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       729
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       195
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         8
{txt}{col 50}No. censored{col 67}={col 69}{res}       173

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}     0.69
{txt}Log pseudolikelihood = {res}-52.073904{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.7096

{txt}{ralign 79:(Std. Err. adjusted for {res:117} clusters in divid)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} 1.158536{col 27}{space 2} .7732856{col 38}{space 1}    0.22{col 47}{space 3}0.826{col 55}{space 4} .3131554{col 68}{space 3}  4.28607
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 1.964796{col 27}{space 2} 1.742942{col 38}{space 1}    0.76{col 47}{space 3}0.446{col 55}{space 4} .3453256{col 68}{space 3} 11.17908
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
{txt}end of do-file

{com}. do "/var/folders/d4/6gqm1mxx0ldg_06bfwv5hxy80000gn/T//SD40586.000000"
{txt}
{com}. ***************************************************************
. ********************** TABLE A3 *******************************
. ***************************************************************
. 
. reg  perfchange4 demotiondummy if fighting==1, r cluster(divid)

{txt}Linear regression                               Number of obs     = {res}        69
                                                {txt}{help j_robustsingular:F(0, 46) }         =  {res}        .
                                                {txt}Prob > F          = {res}         .
                                                {txt}R-squared         = {res}    0.0203
                                                {txt}Root MSE          =    {res} .85506

{txt}{ralign 79:(Std. Err. adjusted for {res:47} clusters in divid)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}  perfchange4{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
demotiondummy {c |}{col 15}{res}{space 2} 1.014706{col 27}{space 2} .0932767{col 38}{space 1}   10.88{col 47}{space 3}0.000{col 55}{space 4} .8269496{col 68}{space 3} 1.202462
{txt}{space 8}_cons {c |}{col 15}{res}{space 2} .9852941{col 27}{space 2} .0932767{col 38}{space 1}   10.56{col 47}{space 3}0.000{col 55}{space 4} .7975378{col 68}{space 3}  1.17305
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. ***************************************************************
. ********************** TABLE A4 *******************************
. ***************************************************************
. 
. reg outcome_v2 compar_test_dummy  if compar_test_dummy==1 | compar_test_dummy03==1, r cluster(divid)

{txt}Linear regression                               Number of obs     = {res}        71
                                                {txt}F(1, 67)          =  {res}     6.95
                                                {txt}Prob > F          = {res}    0.0104
                                                {txt}R-squared         = {res}    0.0519
                                                {txt}Root MSE          =    {res} .65842

{txt}{ralign 79:(Std. Err. adjusted for {res:68} clusters in divid)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}   outcome_v2{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
compar_test~y {c |}{col 15}{res}{space 2} .4801587{col 27}{space 2} .1821787{col 38}{space 1}    2.64{col 47}{space 3}0.010{col 55}{space 4} .1165285{col 68}{space 3} .8437889
{txt}{space 8}_cons {c |}{col 15}{res}{space 2} .2698413{col 27}{space 2} .0858533{col 38}{space 1}    3.14{col 47}{space 3}0.002{col 55}{space 4} .0984773{col 68}{space 3} .4412053
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. ***************************************************************
. ********************** TABLE A5 *******************************
. ***************************************************************
. 
. stset counter, id(gennum) failure(compete=1) /* compete = 1 refers to command demotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          4{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1699{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       1699{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model one
. stcrreg  outcomeave2final  if fighting==1, compete(compete=2) 
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-64.335234}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-64.329494}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-64.329494}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        24
{txt}{col 50}No. censored{col 67}={col 69}{res}       243

{col 50}{txt}Wald chi2({res}1{txt}){col 67}={col 70}{res}     6.05
{txt}Log pseudolikelihood = {res}-64.329494{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0139

{txt}{ralign 79:(Std. Err. adjusted for {res:281} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2}  .380353{col 27}{space 2} .1494241{col 38}{space 1}   -2.46{col 47}{space 3}0.014{col 55}{space 4} .1761111{col 68}{space 3} .8214608
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model three
. stcrreg  outcomeave2final college if fighting==1 & countrycode == 2, compete(compete=2)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-19.461966}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-19.461773}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-19.461773}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       472
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        82
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         6
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        10
{txt}{col 50}No. censored{col 67}={col 69}{res}        66

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}    10.67
{txt}Log pseudolikelihood = {res}-19.461773{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0048

{txt}{ralign 79:(Std. Err. adjusted for {res:82} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .1256334{col 27}{space 2} .0803993{col 38}{space 1}   -3.24{col 47}{space 3}0.001{col 55}{space 4} .0358408{col 68}{space 3} .4403856
{txt}{space 6}college {c |}{col 15}{res}{space 2}  .419995{col 27}{space 2} .4784194{col 38}{space 1}   -0.76{col 47}{space 3}0.446{col 55}{space 4} .0450437{col 68}{space 3} 3.916104
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model five
. stcrreg  outcomeave2final ss if fighting==1 & countrycode == 255, compete(compete=2) tvc(outcomeave2final)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-29.148199}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-29.147483}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-29.147476}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-29.147476}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       729
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       195
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         8
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        14
{txt}{col 50}No. censored{col 67}={col 69}{res}       173

{col 50}{txt}Wald chi2({res}3{txt}){col 67}={col 70}{res}   659.83
{txt}Log pseudolikelihood = {res}-29.147476{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{ralign 79:(Std. Err. adjusted for {res:195} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}main          {txt}{c |}
outcomeave2~l {c |}{col 15}{res}{space 2} .0098896{col 27}{space 2} .0088804{col 38}{space 1}   -5.14{col 47}{space 3}0.000{col 55}{space 4} .0017015{col 68}{space 3}   .05748
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 2.49e-07{col 27}{space 2} 1.53e-07{col 38}{space 1}  -24.69{col 47}{space 3}0.000{col 55}{space 4} 7.45e-08{col 68}{space 3} 8.33e-07
{txt}{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}tvc           {txt}{c |}
outcomeave2~l {c |}{col 15}{res}{space 2}  2.07716{col 27}{space 2} .3758376{col 38}{space 1}    4.04{col 47}{space 3}0.000{col 55}{space 4} 1.456985{col 68}{space 3} 2.961317
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 4 2}Note: Variables in {res}tvc 
{txt}equation interacted with _t.{p_end}

{com}. 
. ******
. 
. stset counter, id(gennum) failure(compete=2) /* compete = 2 refers to command promotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 2
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          3{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1700{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         30{txt}  failures in single-failure-per-subject data
{res}       1700{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model two
. stcrreg  outcomeave2final  if fighting==1, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-87.885444}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-87.836471}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res: -87.83645}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res: -87.83645}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        23
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}        14
{txt}{col 50}No. censored{col 67}={col 69}{res}       244

{col 50}{txt}Wald chi2({res}1{txt}){col 67}={col 70}{res}     0.08
{txt}Log pseudolikelihood = {res} -87.83645{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.7812

{txt}{ralign 79:(Std. Err. adjusted for {res:281} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .8858849{col 27}{space 2} .3865067{col 38}{space 1}   -0.28{col 47}{space 3}0.781{col 55}{space 4} .3767062{col 68}{space 3}   2.0833
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model four
. stcrreg  outcomeave2final college if fighting==1 & countrycode == 2, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:  -20.0385}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-19.989941}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-19.989852}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-19.989852}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       472
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        82
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}         9
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         6
{txt}{col 50}No. censored{col 67}={col 69}{res}        67

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}     9.77
{txt}Log pseudolikelihood = {res}-19.989852{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0076

{txt}{ralign 79:(Std. Err. adjusted for {res:82} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} 2.284371{col 27}{space 2} 3.626098{col 38}{space 1}    0.52{col 47}{space 3}0.603{col 55}{space 4} .1017681{col 68}{space 3} 51.27691
{txt}{space 6}college {c |}{col 15}{res}{space 2} .1965983{col 27}{space 2} .1026458{col 38}{space 1}   -3.12{col 47}{space 3}0.002{col 55}{space 4} .0706577{col 68}{space 3} .5470161
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model six
. stcrreg  outcomeave2final ss  if fighting==1 & countrycode == 255, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res: -52.08251}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-52.073904}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-52.073904}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       729
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       195
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         8
{txt}{col 50}No. censored{col 67}={col 69}{res}       173

{col 50}{txt}Wald chi2({res}2{txt}){col 67}={col 70}{res}     0.53
{txt}Log pseudolikelihood = {res}-52.073904{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.7679

{txt}{ralign 79:(Std. Err. adjusted for {res:195} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} 1.158536{col 27}{space 2} .6904578{col 38}{space 1}    0.25{col 47}{space 3}0.805{col 55}{space 4} .3602594{col 68}{space 3} 3.725666
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 1.964796{col 27}{space 2} 1.927542{col 38}{space 1}    0.69{col 47}{space 3}0.491{col 55}{space 4} .2872468{col 68}{space 3} 13.43939
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. ***************************************************************
. ********************** TABLE A6 *******************************
. ***************************************************************
. 
. stset counter, id(gennum) failure(compete=1) /* compete = 1 refers to command demotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 1
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          4{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1699{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         19{txt}  failures in single-failure-per-subject data
{res}       1699{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model one
. stcrreg  outcomeave2final yearmon italy north_africa if fighting==1, compete(compete=2) 
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-63.355955}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-63.334264}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-63.334252}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-63.334252}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        24
{txt}{col 50}No. censored{col 67}={col 69}{res}       243

{col 50}{txt}Wald chi2({res}4{txt}){col 67}={col 70}{res}     8.24
{txt}Log pseudolikelihood = {res}-63.334252{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0832

{txt}{ralign 79:(Std. Err. adjusted for {res:281} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .3666968{col 27}{space 2} .1510024{col 38}{space 1}   -2.44{col 47}{space 3}0.015{col 55}{space 4} .1636026{col 68}{space 3} .8219096
{txt}{space 6}yearmon {c |}{col 15}{res}{space 2} .9780624{col 27}{space 2} .0373497{col 38}{space 1}   -0.58{col 47}{space 3}0.561{col 55}{space 4} .9075307{col 68}{space 3} 1.054076
{txt}{space 8}italy {c |}{col 15}{res}{space 2} 1.803328{col 27}{space 2} 1.225407{col 38}{space 1}    0.87{col 47}{space 3}0.386{col 55}{space 4} .4760598{col 68}{space 3} 6.831056
{txt}{space 1}north_africa {c |}{col 15}{res}{space 2} 1.263852{col 27}{space 2} 2.077413{col 38}{space 1}    0.14{col 47}{space 3}0.887{col 55}{space 4} .0504154{col 68}{space 3}  31.6832
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model three
. stcrreg  outcomeave2final yearmon  milacademy italy north_africa if fighting==1 & countrycode == 2, compete(compete=2)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-19.143299}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-19.142746}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-19.142746}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       488
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        85
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         6
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        10
{txt}{col 50}No. censored{col 67}={col 69}{res}        69

{col 50}{txt}Wald chi2({res}5{txt}){col 67}={col 70}{res}    27.54
{txt}Log pseudolikelihood = {res}-19.142746{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{ralign 79:(Std. Err. adjusted for {res:85} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .1686178{col 27}{space 2} .0924227{col 38}{space 1}   -3.25{col 47}{space 3}0.001{col 55}{space 4} .0575895{col 68}{space 3} .4937005
{txt}{space 6}yearmon {c |}{col 15}{res}{space 2}  .922718{col 27}{space 2} .0364229{col 38}{space 1}   -2.04{col 47}{space 3}0.042{col 55}{space 4} .8540221{col 68}{space 3} .9969397
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} .7465592{col 27}{space 2} .6112892{col 38}{space 1}   -0.36{col 47}{space 3}0.721{col 55}{space 4} .1500006{col 68}{space 3} 3.715657
{txt}{space 8}italy {c |}{col 15}{res}{space 2} .5306453{col 27}{space 2} .4718537{col 38}{space 1}   -0.71{col 47}{space 3}0.476{col 55}{space 4} .0928773{col 68}{space 3} 3.031789
{txt}{space 1}north_africa {c |}{col 15}{res}{space 2} .4778543{col 27}{space 2} .5638193{col 38}{space 1}   -0.63{col 47}{space 3}0.531{col 55}{space 4} .0473113{col 68}{space 3} 4.826434
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model five
. stcrreg  outcomeave2final yearmon  ss italy north_africa if fighting==1 & countrycode == 255, compete(compete=2) tvc(outcomeave2final)
{res}
         {txt}failure _d:  {res}compete == 1
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-28.002319}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-27.980553}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-27.980537}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-27.980535}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       729
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       195
{txt}Failure event{col 16}: {res}compete == 1{txt}{col 50}No. failed{col 67}={col 69}{res}         8
{txt}Competing event{col 16}: {res}compete == 2{txt}{col 50}No. competing{col 67}={col 69}{res}        14
{txt}{col 50}No. censored{col 67}={col 69}{res}       173

{col 50}{txt}Wald chi2({res}6{txt}){col 67}={col 70}{res}   544.13
{txt}Log pseudolikelihood = {res}-27.980535{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{ralign 79:(Std. Err. adjusted for {res:195} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}main          {txt}{c |}
outcomeave2~l {c |}{col 15}{res}{space 2} .0075727{col 27}{space 2} .0075391{col 38}{space 1}   -4.90{col 47}{space 3}0.000{col 55}{space 4}  .001076{col 68}{space 3} .0532935
{txt}{space 6}yearmon {c |}{col 15}{res}{space 2} 1.020591{col 27}{space 2}  .060432{col 38}{space 1}    0.34{col 47}{space 3}0.731{col 55}{space 4} .9087608{col 68}{space 3} 1.146182
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 1.10e-06{col 27}{space 2} 7.85e-07{col 38}{space 1}  -19.19{col 47}{space 3}0.000{col 55}{space 4} 2.70e-07{col 68}{space 3} 4.46e-06
{txt}{space 8}italy {c |}{col 15}{res}{space 2} 4.201478{col 27}{space 2} 4.850639{col 38}{space 1}    1.24{col 47}{space 3}0.214{col 55}{space 4} .4372034{col 68}{space 3} 40.37576
{txt}{space 1}north_africa {c |}{col 15}{res}{space 2} 4.202416{col 27}{space 2} 9.030046{col 38}{space 1}    0.67{col 47}{space 3}0.504{col 55}{space 4} .0622958{col 68}{space 3} 283.4911
{txt}{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}tvc           {txt}{c |}
outcomeave2~l {c |}{col 15}{res}{space 2}  2.04354{col 27}{space 2} .3752965{col 38}{space 1}    3.89{col 47}{space 3}0.000{col 55}{space 4} 1.425804{col 68}{space 3} 2.928913
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 4 2}Note: Variables in {res}tvc 
{txt}equation interacted with _t.{p_end}

{com}. 
. ******
. 
. stset counter, id(gennum) failure(compete=2) /* compete = 2 refers to command promotion */

                {txt}id:  {res}gennum
     {txt}failure event:  {res}compete == 2
{txt}obs. time interval:  {res}(counter[_n-1], counter]
{txt} exit on or before:  {res}failure

{txt}{hline 78}
{res}       1704{txt}  total observations
{res}          1{txt}  ignored because gennum missing
{res}          3{txt}  observations begin on or after (first) failure
{hline 78}
{res}       1700{txt}  observations remaining, representing
{res}        320{txt}  subjects
{res}         30{txt}  failures in single-failure-per-subject data
{res}       1700{txt}  total analysis time at risk and under observation
                                                at risk from t = {res}        0
                                     {txt}earliest observed entry t = {res}        0
                                          {txt}last observed exit t = {res}       25
{txt}
{com}. * model two
. stcrreg  outcomeave2final yearmon  italy north_africa  if fighting==1, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-83.711294}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-83.579684}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-83.579517}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-83.579517}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}     1,218
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       281
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        23
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}        14
{txt}{col 50}No. censored{col 67}={col 69}{res}       244

{col 50}{txt}Wald chi2({res}4{txt}){col 67}={col 70}{res}    11.98
{txt}Log pseudolikelihood = {res}-83.579517{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0175

{txt}{ralign 79:(Std. Err. adjusted for {res:281} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .8433349{col 27}{space 2} .3703278{col 38}{space 1}   -0.39{col 47}{space 3}0.698{col 55}{space 4}   .35663{col 68}{space 3} 1.994262
{txt}{space 6}yearmon {c |}{col 15}{res}{space 2} .9090783{col 27}{space 2} .0314107{col 38}{space 1}   -2.76{col 47}{space 3}0.006{col 55}{space 4} .8495528{col 68}{space 3} .9727745
{txt}{space 8}italy {c |}{col 15}{res}{space 2}  1.14173{col 27}{space 2} .5460164{col 38}{space 1}    0.28{col 47}{space 3}0.782{col 55}{space 4} .4471859{col 68}{space 3}    2.915
{txt}{space 1}north_africa {c |}{col 15}{res}{space 2} .2708535{col 27}{space 2}  .294487{col 38}{space 1}   -1.20{col 47}{space 3}0.230{col 55}{space 4} .0321559{col 68}{space 3} 2.281434
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model four
. stcrreg  outcomeave2final yearmon  milacademy italy north_africa if fighting==1 & countrycode == 2, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-21.140506}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res:-21.081144}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res:-21.080946}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res:-21.080945}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       488
{txt}{col 50}No. of subjects{col 67}={col 69}{res}        85
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}         9
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         6
{txt}{col 50}No. censored{col 67}={col 69}{res}        70

{col 50}{txt}Wald chi2({res}5{txt}){col 67}={col 70}{res}   478.77
{txt}Log pseudolikelihood = {res}-21.080945{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{ralign 79:(Std. Err. adjusted for {res:85} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2}  1.50854{col 27}{space 2} 1.990149{col 38}{space 1}    0.31{col 47}{space 3}0.755{col 55}{space 4} .1136592{col 68}{space 3} 20.02207
{txt}{space 6}yearmon {c |}{col 15}{res}{space 2} .9136212{col 27}{space 2} .0464158{col 38}{space 1}   -1.78{col 47}{space 3}0.075{col 55}{space 4} .8270305{col 68}{space 3} 1.009278
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2} .8833002{col 27}{space 2} .4826768{col 38}{space 1}   -0.23{col 47}{space 3}0.820{col 55}{space 4} .3026717{col 68}{space 3} 2.577774
{txt}{space 8}italy {c |}{col 15}{res}{space 2} .8122679{col 27}{space 2} .5842314{col 38}{space 1}   -0.29{col 47}{space 3}0.773{col 55}{space 4} .1983648{col 68}{space 3} 3.326091
{txt}{space 1}north_africa {c |}{col 15}{res}{space 2} 6.51e-09{col 27}{space 2} 8.16e-09{col 38}{space 1}  -15.05{col 47}{space 3}0.000{col 55}{space 4} 5.60e-10{col 68}{space 3} 7.58e-08
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. * model six
. stcrreg  outcomeave2final yearmon  ss italy north_africa  if fighting==1 & countrycode == 255, compete(compete=1)
{res}
         {txt}failure _d:  {res}compete == 2
   {txt}analysis time _t:  {res}counter
                 {txt}id:  {res}gennum

{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-48.669946}  
{res}{txt}Iteration 1:{space 3}log pseudolikelihood = {res: -48.60181}  
{res}{txt}Iteration 2:{space 3}log pseudolikelihood = {res: -48.60179}  
{res}{txt}Iteration 3:{space 3}log pseudolikelihood = {res: -48.60179}  
{res}
{txt}Competing-risks regression{col 50}No. of obs{col 67}={col 69}{res}       729
{txt}{col 50}No. of subjects{col 67}={col 69}{res}       195
{txt}Failure event{col 16}: {res}compete == 2{txt}{col 50}No. failed{col 67}={col 69}{res}        14
{txt}Competing event{col 16}: {res}compete == 1{txt}{col 50}No. competing{col 67}={col 69}{res}         8
{txt}{col 50}No. censored{col 67}={col 69}{res}       173

{col 50}{txt}Wald chi2({res}5{txt}){col 67}={col 70}{res}    10.23
{txt}Log pseudolikelihood = {res} -48.60179{col 50}{txt}Prob > chi2{col 67}={col 73}{res}0.0690

{txt}{ralign 79:(Std. Err. adjusted for {res:195} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}           _t{col 15}{c |}        SHR{col 27}   Std. Err.{col 39}      z{col 47}   P>|z|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
outcomeave2~l {c |}{col 15}{res}{space 2} .8758989{col 27}{space 2} .5353986{col 38}{space 1}   -0.22{col 47}{space 3}0.828{col 55}{space 4} .2643333{col 68}{space 3} 2.902393
{txt}{space 6}yearmon {c |}{col 15}{res}{space 2} .8874221{col 27}{space 2} .0467096{col 38}{space 1}   -2.27{col 47}{space 3}0.023{col 55}{space 4} .8004369{col 68}{space 3} .9838602
{txt}{space 11}ss {c |}{col 15}{res}{space 2} 2.943802{col 27}{space 2} 3.017443{col 38}{space 1}    1.05{col 47}{space 3}0.292{col 55}{space 4} .3948331{col 68}{space 3} 21.94843
{txt}{space 8}italy {c |}{col 15}{res}{space 2}  1.13002{col 27}{space 2} .9490164{col 38}{space 1}    0.15{col 47}{space 3}0.884{col 55}{space 4} .2178852{col 68}{space 3} 5.860632
{txt}{space 1}north_africa {c |}{col 15}{res}{space 2} .1759557{col 27}{space 2} .3215865{col 38}{space 1}   -0.95{col 47}{space 3}0.342{col 55}{space 4} .0048944{col 68}{space 3} 6.325678
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. ***************************************************************
. ********************** TABLE A7 *******************************
. ***************************************************************
. 
. reg  perfchange4 demotiondummy batcommand regbrigcommand milacademy countrycode yearmon north_africa w_europe if fighting==1, r cluster(gennum)

{txt}Linear regression                               Number of obs     = {res}        56
                                                {txt}{help j_robustsingular:F(7, 46) }         =  {res}        .
                                                {txt}Prob > F          = {res}         .
                                                {txt}R-squared         = {res}    0.1046
                                                {txt}Root MSE          =    {res} .90489

{txt}{ralign 79:(Std. Err. adjusted for {res:47} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}  perfchange4{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
demotiondummy {c |}{col 15}{res}{space 2} 1.176696{col 27}{space 2} .5571368{col 38}{space 1}    2.11{col 47}{space 3}0.040{col 55}{space 4} .0552377{col 68}{space 3} 2.298154
{txt}{space 3}batcommand {c |}{col 15}{res}{space 2} .1169982{col 27}{space 2} .2690352{col 38}{space 1}    0.43{col 47}{space 3}0.666{col 55}{space 4}-.4245417{col 68}{space 3}  .658538
{txt}regbrigcomm~d {c |}{col 15}{res}{space 2}-.2514385{col 27}{space 2} .3854873{col 38}{space 1}   -0.65{col 47}{space 3}0.517{col 55}{space 4}-1.027384{col 68}{space 3} .5245071
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2}-.3523475{col 27}{space 2} .5180847{col 38}{space 1}   -0.68{col 47}{space 3}0.500{col 55}{space 4}-1.395198{col 68}{space 3}  .690503
{txt}{space 2}countrycode {c |}{col 15}{res}{space 2} .0000285{col 27}{space 2} .0018089{col 38}{space 1}    0.02{col 47}{space 3}0.987{col 55}{space 4}-.0036126{col 68}{space 3} .0036697
{txt}{space 6}yearmon {c |}{col 15}{res}{space 2}-.0658132{col 27}{space 2} .0528212{col 38}{space 1}   -1.25{col 47}{space 3}0.219{col 55}{space 4}-.1721367{col 68}{space 3} .0405103
{txt}{space 1}north_africa {c |}{col 15}{res}{space 2}-1.642836{col 27}{space 2} 1.368561{col 38}{space 1}   -1.20{col 47}{space 3}0.236{col 55}{space 4}-4.397606{col 68}{space 3} 1.111934
{txt}{space 5}w_europe {c |}{col 15}{res}{space 2} .3055829{col 27}{space 2} .3815922{col 38}{space 1}    0.80{col 47}{space 3}0.427{col 55}{space 4}-.4625224{col 68}{space 3} 1.073688
{txt}{space 8}_cons {c |}{col 15}{res}{space 2} 3.827204{col 27}{space 2} 2.136613{col 38}{space 1}    1.79{col 47}{space 3}0.080{col 55}{space 4}-.4735753{col 68}{space 3} 8.127984
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. ***************************************************************
. ********************** TABLE A8 *******************************
. ***************************************************************
. 
. reg outcome_v2 compar_test_dummy batcommand regbrigcommand milacademy countrycode yearmon north_africa w_europe if compar_test_dummy==1 | compar_test_dummy03==1, r cluster(gennum)

{txt}Linear regression                               Number of obs     = {res}        59
                                                {txt}F(8, 57)          =  {res}     4.94
                                                {txt}Prob > F          = {res}    0.0001
                                                {txt}R-squared         = {res}    0.3572
                                                {txt}Root MSE          =    {res} .60935

{txt}{ralign 79:(Std. Err. adjusted for {res:58} clusters in gennum)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}   outcome_v2{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
compar_test~y {c |}{col 15}{res}{space 2} .4416709{col 27}{space 2} .2032681{col 38}{space 1}    2.17{col 47}{space 3}0.034{col 55}{space 4} .0346336{col 68}{space 3} .8487081
{txt}{space 3}batcommand {c |}{col 15}{res}{space 2}-.2738656{col 27}{space 2} .1974672{col 38}{space 1}   -1.39{col 47}{space 3}0.171{col 55}{space 4}-.6692869{col 68}{space 3} .1215556
{txt}regbrigcomm~d {c |}{col 15}{res}{space 2}  .198647{col 27}{space 2} .2094283{col 38}{space 1}    0.95{col 47}{space 3}0.347{col 55}{space 4} -.220726{col 68}{space 3} .6180201
{txt}{space 3}milacademy {c |}{col 15}{res}{space 2}-.0290678{col 27}{space 2} .2012533{col 38}{space 1}   -0.14{col 47}{space 3}0.886{col 55}{space 4}-.4320706{col 68}{space 3} .3739349
{txt}{space 2}countrycode {c |}{col 15}{res}{space 2}-.0026393{col 27}{space 2} .0008424{col 38}{space 1}   -3.13{col 47}{space 3}0.003{col 55}{space 4}-.0043262{col 68}{space 3}-.0009524
{txt}{space 6}yearmon {c |}{col 15}{res}{space 2}-.0055926{col 27}{space 2} .0120341{col 38}{space 1}   -0.46{col 47}{space 3}0.644{col 55}{space 4}-.0296904{col 68}{space 3} .0185052
{txt}{space 1}north_africa {c |}{col 15}{res}{space 2}-.5084994{col 27}{space 2} .6518973{col 38}{space 1}   -0.78{col 47}{space 3}0.439{col 55}{space 4}-1.813901{col 68}{space 3} .7969025
{txt}{space 5}w_europe {c |}{col 15}{res}{space 2}-.3569404{col 27}{space 2} .1901366{col 38}{space 1}   -1.88{col 47}{space 3}0.066{col 55}{space 4}-.7376824{col 68}{space 3} .0238016
{txt}{space 8}_cons {c |}{col 15}{res}{space 2} 1.147752{col 27}{space 2}  .651684{col 38}{space 1}    1.76{col 47}{space 3}0.084{col 55}{space 4}-.1572228{col 68}{space 3} 2.452727
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. 
. 
. ******************** END OF FILE ******************************
. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/Drew/Dropbox/Emory/Ongoing Projects/generals project/FPA_manuscript/log_20170326.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}26 Mar 2017, 17:51:13
{txt}{.-}
{smcl}
{txt}{sf}{ul off}